select [col_name]
from [table_name]
where [conditions]
HAVING [col_name]
ORDER BY [col_name]
select * from dbo.employee
select * from dbo.department
select * → 一次取得整張資料表裡所有的資料
SELECT DISTINCT →去重複值
SELECT COUNT(DISTINCT COLUMNS) FROM TABLE →来计算非重复结果的数目
WHERE子句用來篩選COLUMN
可多個查詢條件式
BETWEEN .... AND ....運算子: 介於兩個值之間,包括兩個值
WHERE col_name| expr BETWEEN value1 AND value2
WHERE col_name| expr BETWEEN value1 AND value2
IN運算子: 必須在所列的值之中
WHERE col_name| expr IN (value1, value2, ...);